import request from '@/utils/request'

export function getPageUser(page) {
    return request({
        url: '/user/getPageUser/'+page.pageNo+'/'+page.pageSize,
        method: 'get',
    })
}

export function getPageUserByCondition(page,condition) {
    return request({
        url: '/user/getPageUserByCondition/'+page.pageNo+'/'+page.pageSize,
        method: 'get',
        params:condition
    })
}
export function saveUser(data) {
    return request({
        url: '/user/saveUser',
        method: 'post',
        data
    })
}

export function getUserDetail(id) {
    return request({
        url: '/user/getUserDetail/'+id,
        method: 'get',
    })
}

export function freezeUser(data) {
    return request({
        url: '/user/freezeUser',
        method: 'put',
        data
    })
}

export function updateUser(data) {
    return request({
        url: '/user/updateUser',
        method: 'put',
        data
    })
}

export function updatePassword(data) {
    return request({
        url: '/user/updatePassword/'+data.id+'/'+data.password,
        method: 'put',
    })
}

export function deleteUser(id) {
    return request({
        url: '/user/deleteUser/'+id,
        method: 'delete',
    })
}
